<!--#INCLUDE FILE="conn.asp"-->
<!-- #include file="aFunction_charCode.asp" -->
<!-- #include file="ad_function.asp" -->
<!-- #include file="ad_comSub.asp" -->

<%
Call tslt_useridentity12_error_end()
%>

<html>
<head>
<title></title>
<link href=../style/<%=session("tslt_stylefolder")%>/admin.css rel="stylesheet" type="text/css">
<body bgcolor=#aaaac4>
<center>
<br>
<table><tr><td class="font2"></td></tr></table>
<br>
<table width="70%" border="0" cellpadding="0" cellspacing="0">
         <tr>
                <td align="left" valign="middle" bgcolor="#f7f6f6">
                     <img src="../images/tushan2.gif" align="middle" width=100 height=50>
                    <font size=2><b><a class=a1 href="bm.asp"></a>&nbsp;>>&nbsp;°</b></font>
                </td>
         </tr> 
</table>

<form name="createfrm" action="bm_create.asp" method="post">
<table width="500" border="0" cellspacing="1" cellpadding="0">
          <tr>
                 <td align="right" width="180"><font size=2>°֣</font></td>
                 <td align="left"><input type="text" name="bdname" value=""></td>
          </tr>
          <tr>
                 <td align="right" width="180" valign="top"><font size=2>°ܣ</font></td>
                 <td><textarea cols="30" rows="5" name="bddetail"></textarea></td>
          </tr>
          <tr>
                  <td align="right" width="180" valign="top"><font size=2>°ͼƬַ</font></td>
                  <td><input type="text" name="bdimg" value="images1/"></td>
          </tr>
          <tr> <td wdith="140" align="right"></td>
                 <td><%call SelectCommunityName()%></td>
          </tr>
</table>
          <tr>
                  <td colspan="2" align="center">
                        <input type="submit" name="submitbtn" value="ִ">
                        &nbsp;&nbsp; 
                        <input type="button" name="cancelbtn" value="ȡ" onClick="location='bm.asp';">
                        <input type="hidden" name="isok" value="yes">  </td>
          </tr>
</table>
</form>
</center>
</body>
</html>

<%
dim bdname,bddetail,bdimg,HiddenSelect
dim isok
isok=request.form("isok")
if isok="yes" then
      bdname=request.form("bdname")
      bddetail=request.form("bddetail")
      bdimg=request.form("bdimg")
      HiddenSelect=request.form("HiddenSelect")

      bdname=trim(bdname)
      bdname=left(bdname,10)
      bddetail=trim(bddetail)
      bdimg=trim(bdimg)
      HiddenSelect=trim(HiddenSelect)

      if bdimg="images1/" or bdimg="" then
            bdimg=""
      end if

      if bdname="" then
            Response.write"<SCRIPT language=Javascript>passwords(promptInfo_bm_create(0))</SCRIPT>"
            Response.End
      else
            dim rs
            dim sql
            sql="select * from board where boardname='"&bdname&"'"
           set rs=conn.Execute(sql)
                  if rs.bof or rs.eof then
                         sql=""
                         sql="insert into board (boardname,boarddetail,boardimg,wordcolor,Communityid)"
                         sql = sql &" values('"& bdname &"','"& bddetail &"','"& bdimg &"','"& MYcolor &"','"& HiddenSelect &"')"
                         conn.Execute(sql)
                         Response.write"<SCRIPT language=Javascript>passwords(promptInfo_bm_create(1))</SCRIPT>"
                         Response.End
                  else
                         Response.write "<SCRIPT language=Javascript>passwords(promptInfo_bm_create(2))</SCRIPT>"
                  end if
           rs.close
           set rs=nothing
      end if
end if
%>

<%
Call conn_Nothing()

sub SelectCommunityName()
        response.write"<select size=1 width=10 name=HiddenSelect>"
              dim rs
              set rs=conn.execute("select CommunityName,id from community order by CommunitySort ASC") 
                    do while not rs.eof
                          response.write"<option value='"&rs("id")&"'>"&rs("CommunityName")&"</option>"
                          rs.movenext 
                    loop
              rs.close
              set rs=nothing
        response.write"</select>"
end sub
%>
